import Vue from 'vue'
import VueRouter from 'vue-router'
// import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import('../views/HomeView.vue'),
    meta:{
      title:"首页"
    }
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue'),
    meta:{
      title:"关于"
    }
  },
  {
    path: '/home-two',
    name: 'home-two',
    component: () => import('../views/home-two.vue'),
    meta:{
      title:"首页2"
    }
  }

]


const router = new VueRouter({
  routes
})
router.beforeEach((to,from,enxt)=>{
  window.document.title = to.meta.title
  enxt()
})

export default router
